package uw10.app.data;

public class Event
{
	public static final int NEW = 0;
	public static final int OLD = 1;
	public static final int STAR = 2;
	
	public int state;
	
	public int id;
	public int icon;
	public int rating;
	
	public long timestamp;
	public int hours;
	public int minutes;
	
	public String company;
	
	private String niceTime;
	
	public Event(String company, int state, int id, int icon, int rating, long timestamp, int hours, int minutes)
	{
		this.company = company;
		this.state = state;
		this.id = id;
		this.icon = icon;
		this.rating = rating;
		this.timestamp = timestamp;
		this.hours = hours;
		this.minutes = minutes;
	}
	
	public String getNiceTime()
	{
		if (niceTime == null)
		{
			String hourStr = String.valueOf(hours);
			if (hours < 10) hourStr = "0" + hourStr;
			String minStr = String.valueOf(minutes);
			if (minutes < 10) minStr = "0" + minStr;
			niceTime =  hourStr + ":" + minStr;
		}
		return niceTime;
	}
}
